package com.woniu.controller.sportsHealth;

import com.github.pagehelper.PageInfo;

import com.woniu.model.sportsHealth.model.dto.WeightDto;
import com.woniu.service.sportsHealth.IWeightService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 体重表 前端控制器
 * </p>
 *
 * @author Jet
 * @since 2023-10-23
 */
@RestController
@RequestMapping("/weight")
public class WeightController {
    @Autowired
    IWeightService weightService;
    @PostMapping("/findAll")
    public ResponseEntity<PageInfo<WeightDto>> findAll(@RequestBody Map<String,Object> param){
        Integer pageNum = (Integer) param.get("pageNum");
        Integer pageSize = (Integer) param.get("pageSize");
        PageInfo<WeightDto> pageInfo = weightService.findAll(param, pageNum, pageSize);
        return ResponseEntity.ok(pageInfo);
    }

}
